//
//  RechargeCellView.m
//  dhfsAPP
//
//  Created by Devil on 2017/8/2.
//  Copyright © 2017年 Devil. All rights reserved.
//
#define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width
#define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height

#define RGB(x,y,z) [UIColor colorWithRed:x / 255.0 green:y / 255.0 blue: z / 255.0 alpha:1.0]
#define WIDTH(x) (x / 750.0) * SCREEN_WIDTH
#define HEIGHT(y) (y / 1334.0) * SCREEN_HEIGHT
#import "RechargeCellView.h"

@interface RechargeCellView()

@property(strong,nonatomic)NSString *payTime,*payMoney;

@property(strong,nonatomic)UILabel *payTimeLabel,*payMoneyLabel;

@end

@implementation RechargeCellView

#pragma mark - 懒加载
-(UILabel *)payTimeLabel{
    if (!_payTimeLabel) {
        _payTimeLabel = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH(96), HEIGHT(67), 0, 0)];
        
        _payTimeLabel.text = self.payTime;
        _payTimeLabel.textColor = RGB(122, 122, 122);
        _payTimeLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:HEIGHT(26)];
        
        [_payTimeLabel sizeToFit];
    }
    
    return _payTimeLabel;
}

-(UILabel *)payMoneyLabel{
    if (!_payMoneyLabel) {
        _payMoneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH(586), HEIGHT(26), 0, 0)];
        
        _payMoneyLabel.text = [NSString stringWithFormat:@"%@汉点",self.payMoney];
        _payMoneyLabel.textColor = RGB(0, 105, 193);
        _payMoneyLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:HEIGHT(26)];
        
        [_payMoneyLabel sizeToFit];
    }
    
    return _payMoneyLabel;
}

#pragma mark - 构造函数
-(instancetype)initWithFrame:(CGRect)frame PayMoney:(NSString *)payMoney PayTime:(NSString *)payTime{
    self = [super initWithFrame:frame];
    
    if (self) {
        self.payTime = payTime;
        self.payMoney = payMoney;
        
        self.backgroundColor = [UIColor whiteColor];
        
        [self initUI];
    }
    
    return self;
}

#pragma mark - 其它函数
-(void)initUI{
    
    UIImageView *imgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"充值"]];
    
    imgV.frame = CGRectMake(WIDTH(38), HEIGHT(19), WIDTH(34), HEIGHT(34));
    
    [self addSubview:imgV];
    
    UILabel *title = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH(96), HEIGHT(17), 0, 0)];
    
    title.text = @"AppStore充值";
    title.textColor = RGB(0, 105, 193);
    title.font = [UIFont fontWithName:@"" size:HEIGHT(28)];
    
    [title sizeToFit];
    
    title.center = CGPointMake(title.center.x, imgV.center.y);
    [self addSubview:title];
    
    [self addSubview:self.payMoneyLabel];
    
    [self addSubview:self.payTimeLabel];
}
@end
